﻿<Page
    x:Class="MJPEGDecoderWinRT.View.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MJPEGDecoderWinRT.View"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    DataContext="{Binding DefaultViewModel.Root, RelativeSource={RelativeSource Self}}"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid x:Name="LayoutRoot" Margin="12,0">

        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Title Panel -->
        <StackPanel Grid.Row="0" Margin="0">
            <TextBlock Text="MJPEG DECODER WINRT" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0"/>
            <TextBlock Text="Home" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
        </StackPanel>

        <!-- Camera data -->
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Margin="0" >
                <TextBlock Text="Camera name" Style="{ThemeResource ControlHeaderTextBlockStyle}" />
                <TextBox Text="{Binding CameraName, Mode=TwoWay}"
                         InputScope="AlphanumericFullWidth" />
            </StackPanel>
            <StackPanel Grid.Row="1" Margin="0,8,0,0" >
                <TextBlock Text="Camera url" Style="{ThemeResource ControlHeaderTextBlockStyle}" />
                <TextBox Text="{Binding CameraUri, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth" />
            </StackPanel>
            <StackPanel Grid.Row="2" Margin="0,8,0,0" >
                <TextBlock Text="Camera username" Style="{ThemeResource ControlHeaderTextBlockStyle}" />
                <TextBox Text="{Binding CameraUserName, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth" />
            </StackPanel>
            <StackPanel Grid.Row="3" Margin="0,8,0,0" >
                <TextBlock Text="Camera user password" Style="{ThemeResource ControlHeaderTextBlockStyle}" />
                <TextBox Text="{Binding CameraPassword, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth" />
            </StackPanel>
            <StackPanel Grid.Row="4" Margin="0,8,0,0" >
                <TextBlock Text="Camera mjpeg resource path" Style="{ThemeResource ControlHeaderTextBlockStyle}" />
                <TextBox Text="{Binding CameraResourcePath, Mode=TwoWay}"
                         TextWrapping="Wrap"
                         InputScope="AlphanumericFullWidth" />
            </StackPanel>
        </Grid>

        <!-- Command -->
        <Button Grid.Row="2"
                Content="Show"
                Command="{Binding ShowCameraPageCmd}" Margin="0,8,0,0"/>
    </Grid>
</Page>
